from django.urls import path

from . import views
from .views import PatientListCreateView, PatientRetrieveUpdateDestroyView

urlpatterns = [
    path('get_image_code/', views.get_image_code, name='get_image_code'),
    path('send_verification_code/', views.send_verification_code, name='send_verification_code'),
    path('login/', views.login, name='login'),
    path('info/', views.UserInfoView.as_view(), name='user_info'),
    path('logout/', views.logout, name='logout'),
    path('patients/', PatientListCreateView.as_view(), name='patients-list-create'),
    path('patients/<int:pk>/', PatientRetrieveUpdateDestroyView.as_view(), name='patients-detail'),
    path('relationtypes/', views.relationtype_list, name='relationtype-list'),
    path('idtypes/', views.idtype_list, name='idtype-list'),
    path('dd/', views.DingTalkLogin.as_view(), name='logout'),
    path('dd/callback/', views.DingTalkCallback.as_view(), name='logout'),
    path('qn/', views.qnToken.as_view(), name='qn-list'),
    path('ocr/', views.ImageOCRView.as_view(), name='image-ocr'),
    
    # 充值系统API
    path('recharge/pay_url/', views.GetRechargePayUrl.as_view(), name='essay-pay-url'),
    path('recharge/result/', views.RechargePayResult.as_view(), name='essay-pay-result'),
    path('recharge/notify/', views.RechargePayNotify.as_view(), name='essay-pay-notify'),
    path('recharge/orders/', views.RechargeOrderQueryView.as_view(), name='essay-orders-query'),
    path('recharge/orders/<str:order_id>/', views.RechargeOrderDetailView.as_view(), name='essay-order-detail'),
    
    # 支付URL API
    path('recharge/payment_urls/', views.PaymentUrlListView.as_view(), name='payment-url-list'),
    path('recharge/payment_urls/<str:order_id>/', views.PaymentUrlDetailView.as_view(), name='payment-url-detail'),
]